 
 
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS3动画类文档 - Layui</title>
<meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="apple-mobile-web-app-status-bar-style" content="black"> 
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no">
  
  <link rel="stylesheet" href="../libs/res.layui.com/layui/dist/css/layui.css-t=1606406696816.css" tppabs="https://res.layui.com/layui/dist/css/layui.css?t=1606406696816"  media="all">
  <link rel="stylesheet" href="../libs/res.layui.com/static/css/global.css-t=1606406696816-19.css" tppabs="https://res.layui.com/static/css/global.css?t=1606406696816-19" media="all">
<style>
.site-doc-icon li{width: 222px;}
.site-doc-icon li .layui-anim{width: 150px; height: 150px; line-height: 150px; margin: 0 auto 10px; text-align: center; background-color: #009688; cursor: pointer; color: #fff; border-radius: 50%;}
</style>
</head>
<body>



<div class="layui-header header header-doc" winter>
  <div class="layui-main">
    <a class="logo" href="javascript:if(confirm('https://www.layui.com/  \n\n���ļ��޷��� Teleport Ultra ����, ��Ϊ ����һ�����·���ⲿ������Ϊ������ʼ��ַ�ĵ�ַ��  \n\n�����ڷ������ϴ���?'))window.location='https://www.layui.com/'" tppabs="https://www.layui.com/">
      <img src="../libs/res.layui.com/static/images/layui/logo.png" tppabs="https://res.layui.com/static/images/layui/logo.png" alt="layui">
    </a>
    <div class="layui-form component" lay-filter="LAY-site-header-component"></div>

  </div>
</div>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
  <script src="../libs/cdn.staticfile.org/html5shiv/r29/html5.min.js" tppabs="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="../libs/cdn.staticfile.org/respond.js/1.4.2/respond.min.js" tppabs="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]--> 
<div class="layui-main site-inline">
  <div class="site-tree">
  <div class="layui-form" style="height: 38px; margin: 10px 13px 0 0;">
    <select lay-filter="tabVersion">
      <option value="new">2.x</option>
      <option value="v1">1.0.9</option>
    </select>
  </div>
  <ul class="layui-tree">
  
    <li><h2>基础说明</h2></li>
  
    <li class="site-tree-noicon ">
      <a href="../index.htm" tppabs="https://www.layui.com/doc/">
        <cite>开始使用</cite>
        <em>Getting Started</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="../base/infrastructure.html" tppabs="https://www.layui.com/doc/base/infrastructure.html">
        <cite>底层方法</cite>
        <em>基础支撑</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="../base/element.html" tppabs="https://www.layui.com/doc/base/element.html">
        <cite>页面元素</cite>
        <em>规范 / 公共类 / 属性</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="../base/modules.html" tppabs="https://www.layui.com/doc/base/modules.html">
        <cite>模块规范</cite>
        <em>使用 / 扩展</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="../base/faq.html" tppabs="https://www.layui.com/doc/base/faq.html">
        <cite>常见问题</cite>
        <em>FAQ</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="../base/changelog.html" tppabs="https://www.layui.com/doc/base/changelog.html">
        <cite>更新日志</cite>
        
          <span class="layui-badge-dot" style="position: relative; top: -2px; left: -4px;"></span>
        
      </a>
    </li>
    
    <li><h2>页面元素</h2></li>
    
    
    <li class="site-tree-noicon ">
      <a href="layout.html" tppabs="https://www.layui.com/doc/element/layout.html">
        <cite>布局</cite>
        <em>栅格 / 后台布局</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="color.html" tppabs="https://www.layui.com/doc/element/color.html">
        <cite>颜色</cite>
        <em>主题色设计感 / 内置背景色</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="icon.html" tppabs="https://www.layui.com/doc/element/icon.html">
        <cite>图标</cite>
        
          <span class="layui-badge-dot" style="position: relative; top: -2px; left: -3px;"></span>
        
        <em>字体图标</em>
      </a>
    </li>
    <li class="site-tree-noicon layui-this">
      <a href="anim.html" tppabs="https://www.layui.com/doc/element/anim.html">
        <cite>动画</cite>
        <em>内置 CSS3 动画</em>
      </a>
    </li>
    
    <li class="site-tree-noicon ">
      <a href="button.html" tppabs="https://www.layui.com/doc/element/button.html">
        <cite>按钮</cite>
        <em>button 组</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="form.html" tppabs="https://www.layui.com/doc/element/form.html">
        <cite>表单</cite>
        <em>form 元素集合</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="nav.html" tppabs="https://www.layui.com/doc/element/nav.html">
        <cite>导航</cite>
        <em>菜单 / 面包屑</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="tab.html" tppabs="https://www.layui.com/doc/element/tab.html">
        <cite>选项卡</cite>
        <em>Tabs 切换</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="progress.html" tppabs="https://www.layui.com/doc/element/progress.html">
        <cite>进度条</cite>
        <em>progress</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="panel.html" tppabs="https://www.layui.com/doc/element/panel.html">
        <cite>面板</cite>
        <em>折叠 / 手风琴</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="table.html" tppabs="https://www.layui.com/doc/element/table.html">
        <cite>表格</cite>
        <em>静态 table</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="badge.html" tppabs="https://www.layui.com/doc/element/badge.html">
        <cite>徽章</cite>
        <em>小圆点 / 小边框</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="timeline.html" tppabs="https://www.layui.com/doc/element/timeline.html">
        <cite>时间线</cite>
        <em>timeline</em>
      </a>
    </li>
    <li class="site-tree-noicon ">
      <a href="auxiliar.html" tppabs="https://www.layui.com/doc/element/auxiliar.html">
        <cite>辅助</cite>
        <em>引用 / 字段集 / 横线等</em>
      </a>
    </li>
   
    
    <li><h2>内置模块</h2></li>
    
    <li class="">
      <a href="../modules/layer.html" tppabs="https://www.layui.com/doc/modules/layer.html">
        <i class="layui-icon" style="top: 3px;">&#xe638;</i><cite>弹出层</cite>
        <em>layer</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/laydate.html" tppabs="https://www.layui.com/doc/modules/laydate.html">
        <i class="layui-icon" style="top: 3px;">&#xe637;</i><cite>日期与时间选择</cite>
        <em>laydate</em>
      </a>
    </li>
    <li >
      <a href="../modules/layim.html" tppabs="https://www.layui.com/doc/modules/layim.html">
        <i class="layui-icon" style="position: relative; top: 3px;">&#xe63a;</i>
        <cite>即时通讯</cite>
        <em>layim</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/laypage.html" tppabs="https://www.layui.com/doc/modules/laypage.html">
        <i class="layui-icon" style="top: 2px;">&#xe633;</i><cite>分页</cite>
        <em>laypage</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/laytpl.html" tppabs="https://www.layui.com/doc/modules/laytpl.html">
        <i class="layui-icon" style="top: 3px;">&#xe628;</i><cite>模板引擎</cite>
        <em>laytpl</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/table.html" tppabs="https://www.layui.com/doc/modules/table.html">
        <i class="layui-icon" style="top: 4px; font-size: 24px; margin-right: -4px;">&#xe62d;</i>
        <cite>数据表格</cite>
        
          <span class="layui-badge-dot" style="position: relative; top: -2px; left: -3px;"></span>
        
        <em>table</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/form.html" tppabs="https://www.layui.com/doc/modules/form.html">
        <i class="layui-icon" style="top: 2px;">&#xe63c;</i>
        <cite>表单</cite>
        <em>form</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/upload.html" tppabs="https://www.layui.com/doc/modules/upload.html">
        <i class="layui-icon" style="font-size: 18px;">&#xe62f;</i>
        <cite>文件上传</cite>
        <em>upload</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/transfer.html" tppabs="https://www.layui.com/doc/modules/transfer.html">
        <i class="layui-icon layui-icon-transfer" style="font-size: 18px; top: 2px;"></i>
        <cite>穿梭框</cite>
        <em>transfer</em>
      </a>
    </li>
    
    <li class="">
      <a href="../modules/tree.html" tppabs="https://www.layui.com/doc/modules/tree.html">
        <i class="layui-icon" style="top: 2px;">&#xe62e;</i>
        <cite>树形组件</cite>
        <em>tree</em>
      </a>
    </li>
    
    <li class="">
      <a href="../modules/colorpicker.html" tppabs="https://www.layui.com/doc/modules/colorpicker.html">
        <i class="layui-icon layui-icon-theme" style="top: 1px; font-size: 18px;"></i>
        <cite>颜色选择器</cite>
        <em>colorpicker</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/element.html" tppabs="https://www.layui.com/doc/modules/element.html">
        <i class="layui-icon" style="top: 1px; font-size: 18px;">&#xe62a;</i>
        <cite>常用元素操作</cite>
        <em>element</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/slider.html" tppabs="https://www.layui.com/doc/modules/slider.html">
        <i class="layui-icon layui-icon-slider" style="top: 1px; font-size: 18px;"></i>
        <cite>滑块</cite>
        <em>slider</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/rate.html" tppabs="https://www.layui.com/doc/modules/rate.html">
        <i class="layui-icon" style="top: 1px; font-size: 22px;">&#xe67b;</i>
        <cite>评分</cite>
        <em>rate</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/carousel.html" tppabs="https://www.layui.com/doc/modules/carousel.html">
        <i class="layui-icon" style="top: 2px;">&#xe634;</i>
        <cite>轮播</cite>
        <em>carousel</em>
      </a>
    </li>
    
    <li class="">
      <a href="../modules/flow.html" tppabs="https://www.layui.com/doc/modules/flow.html">
        <i class="layui-icon">&#xe636;</i>
        <cite>流加载</cite>
        <em>flow</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/util.html" tppabs="https://www.layui.com/doc/modules/util.html">
        <i class="layui-icon">&#xe631;</i>
        <cite>工具集</cite>
        <em>util</em>
      </a>
    </li>
    <li class="">
      <a href="../modules/code.html" tppabs="https://www.layui.com/doc/modules/code.html">
        <i class="layui-icon" style="top: 1px;">&#xe635;</i>
        <cite>代码修饰器</cite>
        <em>code</em>
      </a>
    </li>
  </ul>
</div>

  <div class="site-content">
    <h1 class="site-h1">CSS3动画类</h1>
    <blockquote class="layui-elem-quote">
      在实用价值的前提之下，我们并没有内置过多花俏的动画。而他们同样在 layui 的许多交互元素中，发挥着重要的作用。layui 的动画全部采用 CSS3，因此不支持ie8和部分不支持ie9（即ie8/9无动画）
    </blockquote>
    

<div style="margin: 15px 0; text-align: center; background-color: #F2F2F2;">
  <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-6111334333458862" data-ad-slot="9841027833"></ins>
</div>


    
    <fieldset class="layui-elem-field layui-field-title site-title">
      <legend><a name="use">使用方式</a></legend>
    </fieldset>
    <div class="site-text">
      <p>动画的使用非常简单，直接对元素赋值动画特定的 class 类名即可。如：</p>
      <pre class="layui-code">
其中 layui-anim 是必须的，后面跟着的即是不同的动画类
&lt;div class="layui-anim layui-anim-up">&lt;/div&gt;
 
循环动画，追加：layui-anim-loop
&lt;div class="layui-anim layui-anim-up layui-anim-loop">&lt;/div&gt;
      </pre>
    </div>
  
    <fieldset class="layui-elem-field layui-field-title site-title">
      <legend><a name="use">内置CSS3动画一览表</a></legend>
    </fieldset>
    <div class="site-text">
      <p>下面是不同的动画类名，数量可能有点少的样子？但正如开头所讲的，拒绝冗余花俏，拥抱精简实用。<em>点击下述绿色块，可直接预览动画</em></p>
    </div>
    <ul class="site-doc-icon site-doc-anim">
      <li>
        <div class="layui-anim" data-anim="layui-anim-up">从最底部往上滑入</div>
        <div class="code">layui-anim-up</div>
      </li>
      <li>
        <div class="layui-anim" data-anim="layui-anim-upbit">微微往上滑入</div>
        <div class="code">layui-anim-upbit</div>
      </li>
      <li>
        <div class="layui-anim" data-anim="layui-anim-scale">平滑放大</div>
        <div class="code">layui-anim-scale</div>
      </li>
      <li>
        <div class="layui-anim" data-anim="layui-anim-scaleSpring">弹簧式放大</div>
        <div class="code">layui-anim-scaleSpring</div>
      </li>
      <li>
        <div class="layui-anim" data-anim="layui-anim-fadein">渐现</div>
        <div class="code">layui-anim-fadein</div>
      </li>
      <li>
        <div class="layui-anim" data-anim="layui-anim-fadeout">渐隐</div>
        <div class="code">layui-anim-fadeout</div>
      </li>
      <li>
        <div class="layui-anim" data-anim="layui-anim-rotate">360度旋转</div>
        <div class="code">layui-anim-rotate</div>
      </li>
      <li>
        <div class="layui-anim" data-anim="layui-anim-rotate layui-anim-loop">循环动画</div>
        <div class="code">追加：layui-anim-loop</div>
      </li>
    </ul>
 
    
    <fieldset class="layui-elem-field layui-field-title site-title">
      <legend><a name="docend">结语</a></legend>
    </fieldset>
    <div class="site-text">
      <p>物不在多，有用则精。</p>
    </div>
    
    <div class="layui-elem-quote">
  <p>layui - 用心与你沟通</p>
</div>
    
  </div>
</div>
  
<div class="layui-footer footer footer-doc">
  <div class="layui-main">
    <p>&copy; 2020 <a href="javascript:if(confirm('https://www.layui.com/  \n\n���ļ��޷��� Teleport Ultra ����, ��Ϊ ����һ�����·���ⲿ������Ϊ������ʼ��ַ�ĵ�ַ��  \n\n�����ڷ������ϴ���?'))window.location='https://www.layui.com/'" tppabs="https://www.layui.com/">layui.com</a> MIT license</p>
    <p>
      <!--<a href="http://fly.layui.com/jie/3147/" target="_blank">支持</a>-->
      <!--<a href="javascript:;" site-event="contactInfo">联系</a>-->
      <!--<a href="https://github.com/sentsin/layui/" target="_blank" rel="nofollow">GitHub</a>
      <a href="https://gitee.com/sentsin/layui" target="_blank" rel="nofollow">码云</a>-->
      <a href="javascript:if(confirm('https://www.layui.com/about/disclaimer.html  \n\n���ļ��޷��� Teleport Ultra ����, ��Ϊ ����һ�����·���ⲿ������Ϊ������ʼ��ַ�ĵ�ַ��  \n\n�����ڷ������ϴ���?'))window.location='https://www.layui.com/about/disclaimer.html'" tppabs="https://www.layui.com/about/disclaimer.html" target="_blank" rel="nofollow">免责声明</a>
      <a href="javascript:if(confirm('https://www.layui.com/about/sponsors.html  \n\n���ļ��޷��� Teleport Ultra ����, ��Ϊ ����һ�����·���ⲿ������Ϊ������ʼ��ַ�ĵ�ַ��  \n\n�����ڷ������ϴ���?'))window.location='https://www.layui.com/about/sponsors.html'" tppabs="https://www.layui.com/about/sponsors.html" target="_blank" rel="nofollow">捐赠</a>
      <a href="javascript:if(confirm('https://www.layui.com/about/relatedlinks.html  \n\n���ļ��޷��� Teleport Ultra ����, ��Ϊ ����һ�����·���ⲿ������Ϊ������ʼ��ַ�ĵ�ַ��  \n\n�����ڷ������ϴ���?'))window.location='https://www.layui.com/about/relatedlinks.html'" tppabs="https://www.layui.com/about/relatedlinks.html" target="_blank" rel="nofollow">友链</a>
      <a href="javascript:;"  site-event="weixinmp">公众号</a>
      <a href="javascript:if(confirm('http://beian.miit.gov.cn/  \n\n���ļ��޷��� Teleport Ultra ����, ��Ϊ ����һ�����·���ⲿ������Ϊ������ʼ��ַ�ĵ�ַ��  \n\n�����ڷ������ϴ���?'))window.location='http://beian.miit.gov.cn/'" tppabs="http://beian.miit.gov.cn/" target="_blank" rel="nofollow">赣ICP备13006272号-2</a>
    </p>
    <div class="site-union">
      <p class="site-union-desc">
        <span>
          感谢以下平台提供云加速支持
        </span>
      </p>
      <p>    
        <a href="javascript:if(confirm('https://console.upyun.com/register/?invite=SJ0wu6g2-  \n\n���ļ��޷��� Teleport Ultra ����, ��Ϊ ����һ�����·���ⲿ������Ϊ������ʼ��ַ�ĵ�ַ��  \n\n�����ڷ������ϴ���?'))window.location='https://console.upyun.com/register/?invite=SJ0wu6g2-'" tppabs="https://console.upyun.com/register/?invite=SJ0wu6g2-" target="_blank" rel="nofollow" sponsor="upyun">
          <img src="../libs/res.layui.com/static/images/other/upyun.png-t=1.png" tppabs="https://res.layui.com/static/images/other/upyun.png?t=1" alt="upyun">
        </a>    
        <a href="javascript:if(confirm('https://www.maoyun.com/?from=layui  \n\n���ļ��޷��� Teleport Ultra ����, ��Ϊ ����һ�����·���ⲿ������Ϊ������ʼ��ַ�ĵ�ַ��  \n\n�����ڷ������ϴ���?'))window.location='https://www.maoyun.com/?from=layui'" tppabs="https://www.maoyun.com/?from=layui" target="_blank" rel="nofollow" sponsor="maoyun">
          <img src="../libs/cdn.layui.com/upload/2019_5/168_1559291577683_9348.png" tppabs="https://cdn.layui.com/upload/2019_5/168_1559291577683_9348.png" alt="maoyun">
        </a>
      </p>
    </div>
  </div>
</div>
<script async src="../libs/pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" tppabs="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<div class="site-tree-mobile layui-hide">
  <i class="layui-icon">&#xe602;</i>
</div>
<div class="site-mobile-shade"></div>
<script src="../libs/res.layui.com/layui/dist/layui.js-t=1606406696816" tppabs="https://res.layui.com/layui/dist/layui.js?t=1606406696816" charset="utf-8"></script>
<script>
window.global = {
  pageType: 'doc'
  ,preview: function(){
    var preview = document.getElementById('LAY_preview');
    return preview ? preview.innerHTML : '';
  }()
};
layui.config({
  base: '//res.layui.com/static/lay/modules/layui/'
  ,version: '1606406696816'
}).use('global');
</script>
 
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "../libs/hm.baidu.com/hm.js-d214947968792b839fd669a4decaaffc"/*tpa=https://hm.baidu.com/hm.js?d214947968792b839fd669a4decaaffc*/;
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

<script>
layui.use('jquery', function(){
  var $ = layui.$;
  
  //演示动画
  $('.site-doc-icon .layui-anim').on('click', function(){
    var othis = $(this), anim = othis.data('anim');
 
    //停止循环
    if(othis.hasClass('layui-anim-loop')){
      return othis.removeClass(anim);
    }
    
    othis.removeClass(anim);
    
    setTimeout(function(){
      othis.addClass(anim);
    });
    //恢复渐隐
    if(anim === 'layui-anim-fadeout'){
      setTimeout(function(){
        othis.removeClass(anim);
      }, 1300);
    }
  });
});
</script>
</body>
</html>